#!/bin/sh

set -e
set -x

cd $(dirname $0)

R_VER=$(choco info r -r | grep -o "[0-9].[0-9].[0-9]")

export "PATH=/c/Rtools40/usr/bin:$PATH"
R=C:/Program\ Files/R/R-$R_VER/bin/R.exe

"${R}" CMD build .
"${R}" CMD INSTALL --build duckdb_*.tar.gz